3.968 \(\int (1-x)^n x (1+x)^{-n} \, dx\)

Optimal. Leaf size=61 \[ \frac{2^{-n} n (1-x)^{n+1} \, _2F_1\left (n,n+1;n+2;\frac{1-x}{2}\right )}{n+1}-\frac{1}{2} (1-x)^{n+1} (x+1)^{1-n} \]

[Out]

-((1 - x)^(1 + n)*(1 + x)^(1 - n))/2 + (n*(1 - x)^(1 + n)*Hypergeometric2F1[n, 1
 + n, 2 + n, (1 - x)/2])/(2^n*(1 + n))

_______________________________________________________________________________________

Rubi [A]  time = 0.0476947, antiderivative size = 61, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 16, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.125 \[ \frac{2^{-n} n (1-x)^{n+1} \, _2F_1\left (n,n+1;n+2;\frac{1-x}{2}\right )}{n+1}-\frac{1}{2} (1-x)^{n+1} (x+1)^{1-n} \]

Antiderivative was successfully verified.

[In]  Int[((1 - x)^n*x)/(1 + x)^n,x]

[Out]

-((1 - x)^(1 + n)*(1 + x)^(1 - n))/2 + (n*(1 - x)^(1 + n)*Hypergeometric2F1[n, 1
 + n, 2 + n, (1 - x)/2])/(2^n*(1 + n))

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 5.47795, size = 44, normalized size = 0.72 \[ - \frac{2^{n} n \left (x + 1\right )^{- n + 1}{{}_{2}F_{1}\left (\begin{matrix} - n, - n + 1 \\ - n + 2 \end{matrix}\middle |{\frac{x}{2} + \frac{1}{2}} \right )}}{- n + 1} - \frac{\left (- x + 1\right )^{n + 1} \left (x + 1\right )^{- n + 1}}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate((1-x)**n*x/((1+x)**n),x)

[Out]

-2**n*n*(x + 1)**(-n + 1)*hyper((-n, -n + 1), (-n + 2,), x/2 + 1/2)/(-n + 1) - (
-x + 1)**(n + 1)*(x + 1)**(-n + 1)/2

_______________________________________________________________________________________

Mathematica [C]  time = 0.14617, size = 79, normalized size = 1.3 \[ \frac{3 x^2 (1-x)^n (x+1)^{-n} F_1(2;-n,n;3;x,-x)}{2 (3 F_1(2;-n,n;3;x,-x)-n x (F_1(3;1-n,n;4;x,-x)+F_1(3;-n,n+1;4;x,-x)))} \]

Warning: Unable to verify antiderivative.

[In]  Integrate[((1 - x)^n*x)/(1 + x)^n,x]

[Out]

(3*(1 - x)^n*x^2*AppellF1[2, -n, n, 3, x, -x])/(2*(1 + x)^n*(3*AppellF1[2, -n, n
, 3, x, -x] - n*x*(AppellF1[3, 1 - n, n, 4, x, -x] + AppellF1[3, -n, 1 + n, 4, x
, -x])))

_______________________________________________________________________________________

Maple [F]  time = 0.079, size = 0, normalized size = 0. \[ \int{\frac{ \left ( 1-x \right ) ^{n}x}{ \left ( 1+x \right ) ^{n}}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int((1-x)^n*x/((1+x)^n),x)

[Out]

int((1-x)^n*x/((1+x)^n),x)

_______________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \[ \int{\left (x + 1\right )}^{-n} x{\left (-x + 1\right )}^{n}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(x*(-x + 1)^n/(x + 1)^n,x, algorithm="maxima")

[Out]

integrate((x + 1)^(-n)*x*(-x + 1)^n, x)

_______________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \[{\rm integral}\left (\frac{x{\left (-x + 1\right )}^{n}}{{\left (x + 1\right )}^{n}}, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(x*(-x + 1)^n/(x + 1)^n,x, algorithm="fricas")

[Out]

integral(x*(-x + 1)^n/(x + 1)^n, x)

_______________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \[ \text{Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((1-x)**n*x/((1+x)**n),x)

[Out]

Timed out

_______________________________________________________________________________________

GIAC/XCAS [F]  time = 0., size = 0, normalized size = 0. \[ \int \frac{x{\left (-x + 1\right )}^{n}}{{\left (x + 1\right )}^{n}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(x*(-x + 1)^n/(x + 1)^n,x, algorithm="giac")

[Out]

integrate(x*(-x + 1)^n/(x + 1)^n, x)